<%@include file="startUpIncludes.jsp" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>
           View Lead
        </title>
	 <script type="text/javascript" src="../js/appointments_table.js"></script>
	 <script type="text/javascript" src="../js/calls_table.js"></script>
	 	<script type="text/javascript">
            $(document).ready(function() {
                var leadId = "${lead.id}";
            	var userRoles="${userRoles}";
                appointmentTable(userRoles,leadId);
                callTable(userRoles,leadId);
                });
       </script>
    </head>
    <body>
    <jsp:include page="header.jsp" >
		<jsp:param value="true" name="loggedIn"/>
	</jsp:include>
    <div class="modal-win-bg">
        <div class="modal-win-box">
            <div class="modal-win-hd">
                <span class="modal-win-title"></span>
                <span class="modal-win-close">x</span>
            </div>
            <div class="modal-win-content"></div>
            <a class="form-btn modal-win-ok">OK</a>
        </div>
    </div>
    <div class="wrap">
	<div class="fitBG">
        <div class="main">
		<%@include file="basicLeftMenu.jsp" %>
            <div class="content">
				<jsp:include page="tabs.jsp" >
					<jsp:param value="leads" name="currentPage"/>
				</jsp:include>
                <div class="tab-content">
                <h3> View Lead</h3>
                
				<div class="lead-view">
				<shiro:hasRole name="callAdd">
				<a href="/sales/s/new-call?parentId=${lead.id}&parentType=lead">Add Call</a>
				</shiro:hasRole>
	           	 	<shiro:hasRole name="appointmentAdd">
	           	 	<a href="/sales/s/new-appointment?parentId=${lead.id}&parentType=lead">Add Appointment</a>
	           	 	</shiro:hasRole>	
				</div>
				

                <form class="new-lead-form" method="post" action="/sales/s/viewLead">
                <div class="btns">

                <a href="/sales/s/leads" class="form-btn">Back</a>
                </div>
                <div class="form-row">
                    <h4>Required Information</h4>
                    <input type="hidden" name="id" value="${lead.id}"/>
                    <div class="info"><label>Lead Owner: </label><span>${userDetails.fName}</span></div>
                    <div class="input-col">
                        <label>First Name: </label>
                        <span>${lead.fName}</span>
                        <label>Last Name: </label>
                        <span>${lead.lName}</span>
                      
                    </div>
                    <div class="input-col">
                        <label>Company: </label>
                        <span>${lead.companyName}</span>
                        <label>Lead Status: </label>
                       	<c:choose>
                       	<c:when test="${lead.leadStatus=='--none--'}">
                       		<span>  </span>
                       	</c:when>
                       	<c:otherwise>
							<span>${lead.leadStatus}</span>                       		
                       	</c:otherwise>	
                       	</c:choose>

                    </div>
                </div>
                <div class="form-row">
                    <h4>Lead Information</h4>
                    <div class="input-col">
                        <label>Title: </label>
                        <span>${lead.title}</span>
                        <label>Phone: </label>
                        <span>${lead.phone}</span>
                        <label>Mobile: </label>
                        <span>${lead.mobile}</span>
                    </div>
                    <div class="input-col">
                        <label>Email: </label>
                        <span>${lead.email}</span>
                        <label>Rating: </label>
                        <c:choose>
                       	<c:when test="${lead.rating=='--none--'}">
                       		<span>  </span>
                       	</c:when>
                       	<c:otherwise>
							<span>${lead.rating}</span>                       		
                       	</c:otherwise>	
                       	</c:choose>
                       <label>Sector: </label>
                         <span>${lead.industry}</span>
                    </div>

                </div>
                <div class="form-row">
                    <h4>Address Information</h4>
                    <div class="input-col">
                        <label>Street: </label>
                     	<span>${lead.street}</span>
                        <label>Country: </label>
                        	<c:choose>
                       	<c:when test="${lead.country.countryName=='--none--'}">
                       		<span>  </span>
                       	</c:when>
                       	<c:otherwise>
							<span>${lead.country.countryName}</span>                       		
                       	</c:otherwise>	
                       	</c:choose>
                          <label>Area: </label>
                       <span>${lead.state}</span>
                    </div>
                    <div class="input-col">
                        <label>Zip/Postal Code: </label>
                        <span>${lead.zipCode}</span>
                        <label>City: </label>
                        <span>${lead.city.name}</span>
                        <label>Website: </label>
                       <span>${lead.webSite}</span>
                    </div>
                </div>
                <div class="form-row">
                    <h4>Additional Information</h4>
                    <div class="input-col">
                        <label>In/Out Bound: </label>
                        <span>${lead.inOutBound}</span>
                        <label>Lead Need's Amount: </label>
                        <c:choose>
                       	<c:when test="${lead.carsNum=='--none--'}">
                       		<span>  </span>
                       	</c:when>
                       	<c:otherwise>
							<span>${lead.carsNum}</span>                       		
                       	</c:otherwise>	
                       	</c:choose>
                        <label>Category: </label>
                        <span>${lead.category}</span>
                        <label>Lead Source: </label>
                        <c:choose>
                       	<c:when test="${lead.leadSource=='--none--'}">
                       		<span>  </span>
                       	</c:when>
                       	<c:otherwise>
							<span>${lead.leadSource}</span>                       		
                       	</c:otherwise>	
                       	</c:choose>
                    </div>
                    <div class="input-col">
                        <label>No. of Employees: </label>
                        <span>${lead.numOfEmp}</span>
                        <label>Annual Revenue: </label>
                        <span>${lead.annualRevenue}</span>
                        <label>Description: </label>
                        <span>${lead.description}</span>
                    </div>
                </div>
                 <div class="content-block">
                    <h4>Recent Appointments</h4>
                <div class='table-container'>
                <div class="btns"><br><br></div>
 
                <table class='display appointmentDataTable'>
					   <thead>
					    <tr>
					      <th>Actions</th>
					     <th>Sales Man</th>
					     <th>Contacted Person</th>
                         <th>Date</th>
                         <th>Meeting Done</th>
                         <th>Deal Closing Done</th>
                         <th>Next Follow Up</th>
					    </tr>
					   </thead>
					   <tbody>
					   </tbody>
					   </table>
                </div>
                </div>
                <div class="btns"><br></div>
                  <div class="content-block">
                    <h4>Recent Calls</h4>
                <div class='table-container'>
                <div class="btns">
                <br>
                <br>
                </div>
                <table class='display callsjqueryDataTable'>
					   <thead>
					    <tr>
					      <th>Action</th>
                          <th>CRM Staff</th>
                          <th>Contacted Person</th>
                          <th>Date</th>
                          <th>In/Out</th>
                          <th>Next Follow Up</th>
					    </tr>
					   </thead>
					   <tbody>
					   </tbody>
					   </table>
                </div>
                </div>
                <div class="btns">

                <a href="/sales/s/leads" class="form-btn">Back</a>
                </div>
                </form>
                </div>
            </div>
        </div>
        
	<%@include file="footer.jspf" %>
    </div>
    </div>

    </body>
</html>